package com.qfedu.edu.seckill.exception;

import com.qfedu.edu.seckill.result.ResponseCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
public class BusinessException extends RuntimeException{
    private Integer code;
    private String msg;
    public BusinessException(Integer code,String msg){
      super(msg);
      this.code=code;
      this.msg=msg;
    }

    public BusinessException(ResponseCode responseCode){
        super(responseCode.getMsg());
        this.code=responseCode.getCode();
        this.msg=responseCode.getMsg();
    }
}
